// Copyright 2020 Real-Time Innovations, Inc. (RTI)
//
// Copyleft 2024, Black Sesame Technologies
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef DAL_CONNEXTDDS__DDS_API_HPP_
#define DAL_CONNEXTDDS__DDS_API_HPP_

#include "dal_connextdds/static_config.hpp"
// #include "dal_connextdds/visibility_control.h"

#if DAL_CONNEXT_DDS_API == DAL_CONNEXT_DDS_API_MICRO
#include "dal_connextdds/dds_api_rtime.hpp"
#elif DAL_CONNEXT_DDS_API == DAL_CONNEXT_DDS_API_PRO
#include "dal_connextdds/dds_api_ndds.hpp"
#else
#error "invalid DDS API selected"
#endif /* DAL_CONNEXT_DDS_API */

#ifndef UNUSED_ARG
#define UNUSED_ARG(arg_)        (void)(arg_)
#endif /* UNUSED_ARG */

#define DAL_CONNEXTDDS_PUBLIC

// #include "dal/dal.h"
#include "dal_msg/ret_types.h"
#include "dal_msg/init.h"

#include "dalidl_typesupport_cpp/message_type_support.hpp"

class DAL_Connext_MessageTypeSupport;
struct DAL_Connext_Message;

enum DAL_Connext_MessageType
{
  DAL_CONNEXT_MESSAGE_USERDATA,
  DAL_CONNEXT_MESSAGE_REQUEST,
  DAL_CONNEXT_MESSAGE_REPLY
};

DAL_CONNEXTDDS_PUBLIC extern const char * const DAL_CONNEXTDDS_ID;
extern const char * const DAL_CONNEXTDDS_SERIALIZATION_FORMAT;

bool RegisterType(
  DDS_DomainParticipant * participant,
  const dalidl_message_type_support_t * const type_supports);

bool RegisterTypeCpp(
  DDSDomainParticipant * participant,
  const dalidl_message_type_support_t * const type_supports);

#endif  // DAL_CONNEXTDDS__DDS_API_HPP_
